﻿#ifndef MASKWIDGET_H
#define MASKWIDGET_H

#include <QWidget>

#ifdef quc
#if (QT_VERSION < QT_VERSION_CHECK(5,7,0))
    #include <QtDesigner/QDesignerExportWidget>
#else
    #include <QtUiPlugin/QDesignerExportWidget>
#endif

class QDESIGNER_WIDGET_EXPORT MaskWidget : public QWidget
#else
class MaskWidget : public QWidget
#endif

{
    Q_OBJECT
public:
    static MaskWidget* Instance();
    explicit MaskWidget(QWidget* parent = 0);

protected:
    void showEvent(QShowEvent*);
    bool eventFilter(QObject* obj, QEvent* event);

private:
    static QScopedPointer<MaskWidget> self;
    QWidget* mainWidget;        //需要遮罩的主窗体
    QStringList dialogNames;    //可能弹窗的窗体对象名称集合链表

public Q_SLOTS:
    void setMainWidget(QWidget* mainWidget);
    void setDialogNames(const QStringList& dialogNames);
    void setBgColor(const QColor& bgColor);
    void setOpacity(double opacity);
};

#endif // MASKWIDGET_H
